package com.fsm.common.log.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 *  表定义层。
 *
 * @author 
 * @since 
 */
public class TSystemOperationLogTable extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public static final TSystemOperationLogTable T_SYSTEM_OPERATION_LOG = new TSystemOperationLogTable();

    /**
     * id
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 用户ID
     */
    public final QueryColumn USER_ID = new QueryColumn(this, "user_id");

    /**
     * 系统端类型
     */
    public final QueryColumn SYSTEM_TYPE = new QueryColumn(this, "system_type");

    /**
     * 操作菜单
     */
    public final QueryColumn MENU = new QueryColumn(this, "menu");

    /**
     * 业务操作类型
     */
    public final QueryColumn OPERATION_TYPE = new QueryColumn(this, "operation_type");

    /**
     * 调用状态（0：失败；1：成功）
     */
    public final QueryColumn CALL_STATE = new QueryColumn(this, "call_state");

    /**
     * 访问记录的关键字段和取值
     */
    public final QueryColumn RECORD_KEY = new QueryColumn(this, "record_key");

    /**
     * 操作界面带有注释字段
     */
    public final QueryColumn COMMENTS = new QueryColumn(this, "comments");

    /**
     * 返回结果的数据
     */
    public final QueryColumn RETURN_KEY = new QueryColumn(this, "return_key");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, USER_ID, SYSTEM_TYPE, MENU, OPERATION_TYPE, CALL_STATE, RECORD_KEY, COMMENTS, RETURN_KEY, CREATE_TIME};

    public TSystemOperationLogTable() {
        super("", "t_system_operation_log");
    }

    private TSystemOperationLogTable(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public TSystemOperationLogTable as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new TSystemOperationLogTable("", "t_system_operation_log", alias));
    }

}
